//
//  Contacts.h
//  Contacts
//
//  Created by 李 雷川 on 14-7-16.
//  Copyright (c) 2014年 李 雷川. All rights reserved.
//

#import <Foundation/Foundation.h>
@class Department;
@class Company;
@interface Contact : NSObject{
    NSInteger   userID;
    NSString *password;
    NSString *name;
    NSString *loginName;
    NSString *phone;
    NSString *mobilephone;
    NSString *position; //职位
    NSString *officeNo;
    BOOL     isActivity;
    NSString *headUrl;
    NSString *headName;
    NSString *mark;
    
    NSString    *token;
    Department *department;
    Company    *company;
    
}
@property(nonatomic, assign)NSInteger userID;
@property(nonatomic, strong)NSString *name;
@property(nonatomic, strong)NSString *loginName;
@property(nonatomic, strong)NSString *password;
@property(nonatomic, strong)NSString *phone;
@property(nonatomic, strong)NSString *mobilephone;
@property(nonatomic, strong)Department *department;
@property(nonatomic, strong)NSString *officeNo;
@property(nonatomic, assign)BOOL     isActivity;
@property(nonatomic, retain)NSString *headUrl;
@property(nonatomic, strong)NSString *headName;
@property(nonatomic, strong)Company    *company;
@property(nonatomic, strong)NSString *token;
@property(nonatomic, strong)NSString *mark;
@property(nonatomic, strong)NSString *position; //职位
@property(nonatomic, strong)NSString *namePinyin;
+(Contact *) sharedContact;

+(Contact *)analysisContactWithDic:(NSDictionary *)dic;

+(Contact *)analysisUserInfoDic:(NSDictionary *)dic;

+(NSArray *)departmentContacts:(NSInteger)departmentID;

+(NSArray *)lastContacts;

+(BOOL)saveContact:(Contact *)contact;

+(BOOL)updateContact:(Contact *)contact;

+(BOOL)deleteContact:(Contact *)contact;

+(BOOL)saveContacts:(NSArray *)contacts;

+(BOOL)updateContacts:(NSArray *)contacts;

+(NSArray *)searchContactsWithKey:(NSString *)key;
@end
